#' @export
K2xy2 <- function(K) {
# US patent 7024034, Kim et al. 2006
# This approximation is reasonably accurate for K > 1700 & K < 25000
y <- x <- numeric(length(K))
sK1 <- K <= 4000
K1 <- K[sK1]
x[sK1] <- -0.2661239 * (10^9) / (K1^3) -
0.2343580 * (10^6) / (K1^2) +
0.8776956 * (10^3) / (K1) +
0.1799100
sK2 <- K > 4000
K2 <- K[sK2]
x[sK2] <- -3.0258469 * (10^9) / (K2^3) +
2.1070379 * (10^6) / (K2^2) +
0.2226347 * (10^3) / (K2) +
0.2403900
sx1 <- K <= 2222
x1 <- x[sx1]
y[sx1] <- -1.10638140 * (x1^3) -
1.34811020 * (x1^2) +
2.18555832 * (x1) -
0.20219683
sx2 <- K > 2222 & K <= 4000
x2 <- x[sx2]
y[sx2] <- -0.95494760 * (x2^3) -
1.37418593 * (x2^2) +
2.09137015 * (x2) -
0.16748867
sx3 <- K > 4000
x3 <- x[sx3]
y[sx3] <- 3.08175800 * (x3^3) -
5.87338670 * (x3^2) +
3.75112997 * (x3) -
0.37001483
cbind(x, y)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.